package com.nt.train.enums;
import lombok.Getter;
/**
 * 首先定义业务的类型，按类型区分
 * @author hlf
 * @version 1.0
 * @date 2022/8/5 14:56
 */
@Getter
public enum RequestEnum {

    OPERATION_REQUEST(10, "动作指令", "operationRequestService"),

    COMPOSITE_REQUEST(20, "组合指令", "compositeRequestService"),

    GOAL_REQUEST(30, "目标指令", "goalRequestService"),

    QUERY_REQUEST(40, "查询指令", "queryRequestService"),;
    /**
     * id
     */
    private Integer id;

    /**
     * 实现类
     */
    private String implementClassName;
    /**
     * 名称
     */
    private String name;


    RequestEnum(Integer id, String name, String implementClassName) {
        this.id = id;
        this.name = name;
        this.implementClassName = implementClassName;
    }

    public static RequestEnum getById(Integer id) {
        for (RequestEnum it : RequestEnum.values()) {
            if (it.id.equals(id)) {
                return it;
            }
        }
        return null;
    }
}
